﻿<%@ WebHandler Language="C#" Class="Handler" %>
#region 命名空间

using System;
using System.Web;
using System.Xml;
using WinnerCMS.BLL;

#endregion

public class Handler : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/xml"; //xml格式输出
        var t = context.Request.QueryString["rssURL"]; //url
        var p = context.Request.QueryString["maxRssItems"]; //最多显示的条数
        XmlDocument xml = RssFeedBuilder.Get(new Uri(t)); //获取rss
        xml = RssFeedBuilder.Formate(xml, int.Parse(p)); //格式化rss
        XmlNode xn = xml.CreateElement("tmpIndex"); //添加一个节点，记录将创建模块的编号
        xn.InnerText = context.Request.QueryString["tmpIndex"];
        xml.DocumentElement.AppendChild(xn); //添加编号节点
        context.Response.Write(xml.InnerXml); //输出
    }

    public bool IsReusable //不重用
    {
        get { return false; }
    }
}